package utils

import (
	"fmt"
	"math/rand"
	"regexp"
	"time"
)

func VerifyMobileFormat(mobileNum string) bool {
	regular := "^[1]([3-9])[0-9]{9}$"
	reg := regexp.MustCompile(regular)
	return reg.MatchString(mobileNum)
}

func GenerateVerifyCode() string {
	rnd := rand.New(rand.NewSource(time.Now().UnixNano()))
	return fmt.Sprintf("%04v", rnd.Int31n(10000))
}
